Fix the Properties panel rejecting Obsidian-style empty tags: /…#400
Merged
Conversation
…tter (PRD-7216) (#2295)
* fix(open-knowledge): accept Obsidian-style empty tags/aliases frontmatter (PRD-7216)
Obsidian writes an empty `tags:` / `aliases:` list as a one-element block
sequence whose only item is blank (`tags:\n- `), and a bare `tags:` as a
null scalar. yaml@2 parses both to `null`, which the frontmatter read
schema excluded (null is the RFC 7396 merge-patch delete sentinel). Because
parseFmRegion validates the whole map, one empty list rejected the entire
block: the Properties panel showed nothing and refused every edit, even to
the file's other valid keys. ~92% of a real Obsidian vault is affected.
Coerce these null shapes to empty values at the single read-path boundary
(z.preprocess on FrontmatterMapSchema): null seq element -> dropped
([null] -> []), null mapping value -> '' (empty text). Both structured
readers (parseFmRegion for the panel; parseFrontmatterYaml for disk, the
agent-write gate, and the tag indexer) inherit it, so they can't drift.
The coercion rewrites only the JS view; the yaml CST the write path mutates
is untouched, so files aren't rewritten on disk until the user edits a
property. null stays out of the per-value write/patch schema, so it still
means delete in RFC 7396 patches.
Whole-block reflow on first edit (PRD-7217) is separate and out of scope.
* review: drop session-stat/PRD markers from source comments; pin Obsidian-null at the agent-write HTTP gate
Addresses claude[bot] review on #2295:
- Remove the `~92%` session statistic from the `coerceNullFrontmatter`
JSDoc and the region test comment (it lives in the commit message; in
source it rots without a reproducible query — OK comment discipline).
- Drop the new `PRD-7217` marker from a test comment; keep the substance
("a separate, pre-existing concern").
- Add an integration test: a `replace` agent-write of Obsidian's
`tags:\n- ` / `aliases:\n- ` shape returns 200 (not 400) and reads back
coerced, pinning the HTTP boundary so a future early-guard before the
schema call can't silently regress it.
---------
GitOrigin-RevId: 372b7b9e97091b67debc96a574bed54cec02d923
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28475439166). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the Properties panel rejecting Obsidian-style empty
tags:/aliases:frontmatter. Files that use Obsidian's default "no tags" shape (an emptytags:list whose only item is a blank-, or a baretags:with no value) parse to YAMLnull, which the read schema previously rejected for the whole frontmatter block — so the panel showed nothing (or an error banner) and refused every edit, even to the file's other valid properties. The read path now coerces these empty shapes to empty values (tags:\n-reads as an empty list, a baretags:as empty text), so the panel reads and edits these files normally. Files are not rewritten on disk until you actually edit a property.